cc.PointUtils={
    getDistance:function(p1,p2){
        return p1.sub(p2).mag();
    },
    getXySpeed:function(p1,p2,speed){
        var dis=this.getDistance(p1,p2);
        var t=dis/speed;
        var vx=(p2.x-p1.x)/t;
        var vy=(p2.y-p1.y)/t;
        return cc.v2(vx/60,vy/60);
    },
    getAngle:function(p1,p2){
        var dx = p2.x - p1.x;
        var dy = p2.y - p1.y;
        var dir = cc.v2(dx,dy);
        var angle = dir.signAngle(cc.v2(1,0));
        var degree = angle / Math.PI * 180;
        return -degree;
    },
    getMiddlePoint:function(p1,p2,ratio){
        return cc.v2(p1.x+(p2.x-p1.x)*0.5,p1.y+(p2.y-p1.y)*0.5);
    }
};